<template>
  <view :style="{ marginTop: navbarHeight }">
    <NavigationBar
      title="个人中心"
      backgroundColor="#FCFCFC"
      titleColor="#000"
      ref="navbar"
    />
    <view class="background"></view>
    <!-- 用户信息 -->
    <view class="userInfo">
      <!-- 个性信息 -->
      <view class="personalInfo">
        <!-- 用户头像 -->
        <image
          class="avatar"
          src="/static/individualCenter/pandaer.jpg"
          mode="aspectFit"
        ></image>
        <!-- 用户昵称 -->
        <view class="nickname">
          <text>LanYun</text>
          <view class="pointsMall">积分商城</view>
        </view>
        <view class="vip">
          <image
            src="/static/individualCenter/会员-未激活.png"
            mode="aspectFit"
          ></image>
        </view>
        <button>
          <image
            src="/static/individualCenter/签到.png"
            mode="aspectFit"
          ></image>
          <text>签到</text>
        </button>
      </view>
      <!-- 商户余额 -->
      <view class="balancePanel">
        <!-- 金额 -->
        <view class="amount">
          <text class="quantity">10000.00</text>
          <text class="name">余额</text>
        </view>
        <!-- 积分 -->
        <view class="points">
          <text class="quantity">1222</text>
          <text class="name">积分</text>
        </view>
        <!-- 卡 -->
        <view class="card">
          <text class="quantity">20</text>
          <text class="name">卡</text>
        </view>
        <!-- 优惠劵 -->
        <view class="coupon">
          <text class="quantity">5</text>
          <text class="name">优惠劵</text>
        </view>
      </view>
      <!-- 会员中心 -->
      <view class="memberCenter">
        <view class="title">
          <view class="text">
            <image
              src="/static/individualCenter/会员vip.png"
              mode="aspectFit"
            ></image>
            <text>会员中心</text>
          </view>
          <view class="liberal">
            <text>开通立享多重特权</text>
            <button>9.9元起/立即开通</button>
          </view>
        </view>
        <!-- 会员权益 -->
        <view class="equity">
          <view>
            <image
              src="/static/individualCenter/95折.png"
              mode="aspectFit"
            ></image>
            <text>下单9.5折起</text>
          </view>
          <view>
            <image
              src="/static/individualCenter/卡券多多.png"
              mode="aspectFit"
            ></image>
            <text>卡券多多</text>
          </view>
          <view>
            <image
              src="/static/individualCenter/海量优惠.png"
              mode="aspectFit"
            ></image>
            <text>海量优惠</text>
          </view>
          <view>
            <image
              src="/static/individualCenter/更多权益.png"
              mode="aspectFit"
            ></image>
            <text>更多权益</text>
          </view>
        </view>
      </view>
    </view>
    <view class="wrap">
      <!-- 我的订单 -->
      <view class="title">
        <text class="titleName">我的订单</text>
        <view
          class="allOrder"
          style="margin-left: 340rpx; display: flex; align-items: center"
        >
          <text style="font-size: 26rpx; color: #999">查看全部订单</text>
          <uni-icons type="right" size="20" color="#000"></uni-icons>
        </view>
      </view>
      <view class="list">
        <view>
          <image
            src="/static/individualCenter/待付款.png"
            mode="aspectFit"
          ></image>
          <text>待付款</text>
        </view>
        <view>
          <view class="number">2</view>
          <image
            src="/static/individualCenter/待发货.png"
            mode="aspectFit"
          ></image>
          <text>待发货</text>
        </view>
        <view>
          <image
            src="/static/individualCenter/待收货.png"
            mode="aspectFit"
          ></image>
          <text>待收货</text>
        </view>
        <view>
          <image
            src="/static/individualCenter/评价.png"
            mode="aspectFit"
          ></image>
          <text>评价</text>
        </view>
        <view>
          <image
            src="/static/individualCenter/退货售后.png"
            mode="aspectFit"
          ></image>
          <text>退款/售后</text>
        </view>
      </view>
    </view>
    <view class="wrap">
      <!-- 购物管理 -->
      <view class="title">
        <text class="titleName">购物管理</text>
      </view>
      <view class="list">
        <view>
          <image
            src="/static/individualCenter/购物车.png"
            mode="aspectFit"
          ></image>
          <text>购物车</text>
        </view>
        <view>
          <image
            src="/static/individualCenter/收货地址.png"
            mode="aspectFit"
          ></image>
          <text>收货地址</text>
        </view>
        <view>
          <image
            src="/static/individualCenter/个人信息.png"
            mode="aspectFit"
          ></image>
          <text>个人信息</text>
        </view>
        <view>
          <image
            src="/static/individualCenter/账号设置.png"
            mode="aspectFit"
          ></image>
          <text>账号设置</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import NavigationBar from "../../components/NavigationBar.vue";
export default {
  components: {
    NavigationBar,
  },
  data() {
    return {
      navbarHeight: 0,
    };
  },
  onLoad() {
    this.navbarHeight = this.$refs.navbar.navigationBarHeight;
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.background {
  width: 100%;
  height: 505rpx;
  position: fixed;
  background: linear-gradient(
    180deg,
    rgba(252, 252, 252, 1) 0%,
    rgba(255, 251, 249, 1) 53.55%,
    rgba(248, 225, 214, 1) 100%
  );
  z-index: 1;
  overflow: hidden;
  border-bottom-right-radius: 73rpx;
  border-bottom-left-radius: 73rpx;
}

// 用户信息
.userInfo {
  width: 100%;
  border-top: 1rpx solid #707070;
  position: relative;
  z-index: 99;
  margin: 0 auto;

  // 个性信息
  .personalInfo {
    width: 702rpx;
    height: 100rpx;
    margin: 0 auto;
    margin-top: 50rpx;
    display: flex;
    align-items: center;
    position: relative;

    // 用户头像
    .avatar {
      width: 100rpx;
      height: 100rpx;
      border-radius: 50%;
    }

    // 用户昵称
    .nickname {
      max-width: 216rpx;
      font-size: 36rpx;
      color: #333;
      vertical-align: top;
      margin-left: 20rpx;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;

      .pointsMall {
        width: 125rpx;
        height: 34rpx;
        line-height: 35rpx;
        text-align: center;
        background-color: #fee4d8;
        border-radius: 30rpx;
        font-size: 20rpx;
        color: #333;
      }
    }

    .vip {
      width: 36rpx;
      height: 100%;
      margin-left: 10rpx;

      image {
        width: 36rpx;
        height: 32rpx;
        margin-top: 20rpx;
      }
    }

    button {
      width: 126rpx;
      height: 56rpx;
      line-height: 56rpx;
      border: 1rpx solid $main-color;
      color: $main-color;
      font-size: 26rpx;
      display: flex;
      align-items: center;
      justify-content: space-evenly;
      padding: 0;
      margin: 0;
      position: absolute;
      right: 50rpx;
      background-color: transparent;

      image {
        width: 28rpx;
        height: 28rpx;
        margin-top: -3rpx;
      }
    }
  }

  // 用户余额
  .balancePanel {
    width: 608rpx;
    height: 82rpx;
    margin: 30rpx auto;
    display: flex;
    align-items: center;
    justify-content: space-evenly;

    view {
      flex: 1;
      max-width: 174rpx;
      display: flex;
      align-items: center;
      justify-content: space-around;
      flex-direction: column;

      .quantity {
        width: 100%;
        font-size: 30rpx;
        color: #333;
        font-weight: bold;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        text-align: center;
      }

      .name {
        font-size: 24rpx;
        color: #999;
      }
    }
  }

  // 会员中心
  .memberCenter {
    width: 690rpx;
    height: 222rpx;
    margin: 0 auto;
    margin-top: 22rpx;
    border-bottom-right-radius: 45rpx;
    border-bottom-left-radius: 45rpx;
    border-top-right-radius: 20rpx;
    border-top-left-radius: 20rpx;
    background: url("/static/individualCenter/会员中心.png") no-repeat;
    background-position: 100% 100%;

    .title {
      width: 100%;
      height: 65rpx;
      display: flex;
      align-items: center;

      .text {
        width: 180rpx;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-around;
        font-size: 30rpx;
        color: #8e6544;
        margin-left: 24rpx;

        image {
          width: 51rpx;
          height: 100%;
        }
      }

      .liberal {
        width: 380rpx;
        font-size: 20rpx;
        color: #8e6544;
        display: flex;
        align-items: center;
        justify-content: space-around;
        margin-left: 94rpx;

        button {
          width: 196rpx;
          height: 36rpx;
          line-height: 36rpx;
          text-align: center;
          border-radius: 18rpx;
          color: #fff;
          padding: 0;
          background-color: #ab7044;
          font-size: 20rpx;
        }
      }
    }

    // 会员权益
    .equity {
      width: 100%;
      height: 88rpx;
      display: flex;
      align-items: center;
      justify-content: space-around;
      margin-top: 30rpx;

      view {
        width: 110rpx;
        height: 88rpx;
        display: flex;
        align-items: center;
        flex-direction: column;
        font-size: 20rpx;
        color: #8e6544;

        image {
          width: 58rpx;
          height: 58rpx;
        }
      }
    }
  }
}

.wrap {
  width: 690rpx;
  height: 260rpx;
  background-color: #fff;
  box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.16);
  border-radius: 10rpx;
  margin: 20rpx auto;
  color: #333;
  font-size: 30rpx;
  overflow: hidden;
  position: relative;

  .title {
    width: 100%;
    height: 45rpx;
    margin: 25rpx auto;
    display: flex;
    align-items: center;

    .titleName {
      margin-left: 20rpx;
    }
  }

  .list {
    width: 100%;
    height: 102rpx;
    position: absolute;
    bottom: 37rpx;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;

    view {
      width: 115rpx;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      font-size: 26rpx;
      color: #999;
      position: relative;

      image {
        width: 46rpx;
        height: 46rpx;
      }

      .number {
        width: 32rpx;
        height: 32rpx;
        line-height: 32rpx;
        border-radius: 50%;
        background-color: $main-color;
        color: #fff;
        font-size: 24rpx;
        text-align: center;
        position: absolute;
        right: 18rpx;
        top: -12rpx;
      }
    }
  }
}
</style>
